.class public Lcom/nemustech/tiffany/world/TFShadowPanel;
.super Lcom/nemustech/tiffany/world/TFCustomPanel;
.source "TFShadowPanel.java"


# static fields
.field static final TAG:Ljava/lang/String; = "TFShadowPanel"


# instance fields
.field protected mColorBuffer:Ljava/nio/FloatBuffer;

.field protected mMeshColor:[F


# direct methods
.method public constructor <init>(FF)V
    .locals 1
    .parameter "width"
    .parameter "height"

    .prologue
    const/16 v0, 0x8

    .line 22
    invoke-direct {p0, p1, p2, v0, v0}, Lcom/nemustech/tiffany/world/TFCustomPanel;-><init>(FFII)V

    .line 23
    const/4 v0, 0x0

    iput v0, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mRequestUpdateTexCoordCount:I

    .line 24
    return-void
.end method

.method public constructor <init>(FFII)V
    .locals 1
    .parameter "width"
    .parameter "height"
    .parameter "meshWidth"
    .parameter "meshHeight"

    .prologue
    .line 33
    invoke-direct {p0, p1, p2, p3, p4}, Lcom/nemustech/tiffany/world/TFCustomPanel;-><init>(FFII)V

    .line 34
    const/4 v0, 0x0

    iput v0, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mRequestUpdateTexCoordCount:I

    .line 35
    return-void
.end method


# virtual methods
.method protected buildColorArray()V
    .locals 12

    .prologue
    const/4 v11, 0x0

    .line 76
    iget v5, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshWidth:I

    .line 77
    .local v5, meshW:I
    iget v4, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshHeight:I

    .line 78
    .local v4, meshH:I
    iget v8, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshWidth:I

    add-int/lit8 v7, v8, 0x1

    .line 80
    .local v7, vertexW:I
    iget-object v6, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mTempFloat8:[F

    .line 82
    .local v6, rgba:[F
    iget-object v8, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mColorBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v8, v11}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 83
    const/4 v3, 0x0

    .local v3, j:I
    :goto_0
    if-ge v3, v4, :cond_1

    .line 84
    add-int/lit8 v8, v3, 0x1

    mul-int/2addr v8, v7

    mul-int/lit8 v1, v8, 0x4

    .line 85
    .local v1, index1:I
    mul-int v8, v3, v7

    mul-int/lit8 v2, v8, 0x4

    .line 86
    .local v2, index2:I
    const/4 v0, 0x0

    .local v0, i:I
    :goto_1
    if-gt v0, v5, :cond_0

    .line 87
    iget-object v8, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    add-int/lit8 v9, v1, 0x0

    aget v8, v8, v9

    aput v8, v6, v11

    .line 88
    const/4 v8, 0x1

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    add-int/lit8 v10, v1, 0x1

    aget v9, v9, v10

    aput v9, v6, v8

    .line 89
    const/4 v8, 0x2

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    add-int/lit8 v10, v1, 0x2

    aget v9, v9, v10

    aput v9, v6, v8

    .line 90
    const/4 v8, 0x3

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    add-int/lit8 v10, v1, 0x3

    aget v9, v9, v10

    aput v9, v6, v8

    .line 91
    const/4 v8, 0x4

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    add-int/lit8 v10, v2, 0x0

    aget v9, v9, v10

    aput v9, v6, v8

    .line 92
    const/4 v8, 0x5

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    add-int/lit8 v10, v2, 0x1

    aget v9, v9, v10

    aput v9, v6, v8

    .line 93
    const/4 v8, 0x6

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    add-int/lit8 v10, v2, 0x2

    aget v9, v9, v10

    aput v9, v6, v8

    .line 94
    const/4 v8, 0x7

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    add-int/lit8 v10, v2, 0x3

    aget v9, v9, v10

    aput v9, v6, v8

    .line 95
    iget-object v8, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mColorBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v8, v6}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;

    .line 96
    add-int/lit8 v1, v1, 0x4

    .line 97
    add-int/lit8 v2, v2, 0x4

    .line 86
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 83
    :cond_0
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 100
    .end local v0           #i:I
    .end local v1           #index1:I
    .end local v2           #index2:I
    :cond_1
    iget-object v8, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mColorBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v8, v11}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 101
    return-void
.end method

.method protected drawVertex(Ljavax/microedition/khronos/opengles/GL10;I)V
    .locals 5
    .parameter "gl"
    .parameter "face"

    .prologue
    const v4, 0x8076

    .line 121
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mTextures:Lcom/nemustech/tiffany/world/TFTextures;

    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFTextures;->getTextureCount()I

    move-result v0

    if-nez v0, :cond_0

    const/16 v0, 0xde1

    invoke-interface {p1, v0}, Ljavax/microedition/khronos/opengles/GL10;->glDisable(I)V

    .line 122
    :cond_0
    invoke-interface {p1, v4}, Ljavax/microedition/khronos/opengles/GL10;->glEnableClientState(I)V

    .line 123
    const/4 v0, 0x4

    const/16 v1, 0x1406

    const/4 v2, 0x0

    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mColorBuffer:Ljava/nio/FloatBuffer;

    invoke-interface {p1, v0, v1, v2, v3}, Ljavax/microedition/khronos/opengles/GL10;->glColorPointer(IIILjava/nio/Buffer;)V

    .line 124
    invoke-super {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFCustomPanel;->drawVertex(Ljavax/microedition/khronos/opengles/GL10;I)V

    .line 125
    invoke-interface {p1, v4}, Ljavax/microedition/khronos/opengles/GL10;->glDisableClientState(I)V

    .line 126
    return-void
.end method

.method public getMeshColor()[F
    .locals 1

    .prologue
    .line 116
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    return-object v0
.end method

.method protected loadIdentityColor([F)V
    .locals 7
    .parameter "color"

    .prologue
    const/4 v6, 0x0

    .line 59
    iget v4, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshWidth:I

    .line 60
    .local v4, meshW:I
    iget v2, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshHeight:I

    .line 62
    .local v2, meshH:I
    const/4 v1, 0x0

    .local v1, j:I
    :goto_0
    if-gt v1, v2, :cond_1

    .line 63
    add-int/lit8 v5, v4, 0x1

    mul-int/2addr v5, v1

    mul-int/lit8 v3, v5, 0x4

    .line 65
    .local v3, meshIndex:I
    const/4 v0, 0x0

    .local v0, i:I
    :goto_1
    if-gt v0, v4, :cond_0

    .line 66
    add-int/lit8 v5, v3, 0x0

    aput v6, p1, v5

    .line 67
    add-int/lit8 v5, v3, 0x1

    aput v6, p1, v5

    .line 68
    add-int/lit8 v5, v3, 0x2

    aput v6, p1, v5

    .line 69
    add-int/lit8 v5, v3, 0x3

    aput v6, p1, v5

    .line 70
    add-int/lit8 v3, v3, 0x4

    .line 65
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 62
    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 73
    .end local v0           #i:I
    .end local v3           #meshIndex:I
    :cond_1
    return-void
.end method

.method protected onSetTexture(Ljavax/microedition/khronos/opengles/GL10;II)V
    .locals 1
    .parameter "gl"
    .parameter "index"
    .parameter "layer"

    .prologue
    .line 132
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mTextures:Lcom/nemustech/tiffany/world/TFTextures;

    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFTextures;->getTextureCount()I

    move-result v0

    if-lez v0, :cond_0

    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mTextures:Lcom/nemustech/tiffany/world/TFTextures;

    invoke-virtual {v0, p1, p2, p3}, Lcom/nemustech/tiffany/world/TFTextures;->setTextureByIndex(Ljavax/microedition/khronos/opengles/GL10;II)V

    .line 133
    :cond_0
    return-void
.end method

.method public setHeight(F)V
    .locals 0
    .parameter "height"

    .prologue
    .line 139
    iput p1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mHeight:F

    .line 140
    return-void
.end method

.method public setMeshColor([F)V
    .locals 3
    .parameter "colorBuffer"

    .prologue
    .line 110
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    array-length v1, v1

    if-ge v0, v1, :cond_0

    .line 111
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    aget v2, p1, v0

    aput v2, v1, v0

    .line 110
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 112
    :cond_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFShadowPanel;->buildColorArray()V

    .line 113
    return-void
.end method

.method public setMeshVertex([F)V
    .locals 3
    .parameter "vertexBuffer"

    .prologue
    .line 104
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshVertex:[F

    array-length v1, v1

    if-ge v0, v1, :cond_0

    .line 105
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshVertex:[F

    aget v2, p1, v0

    aput v2, v1, v0

    .line 104
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 106
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFShadowPanel;->buildVertexArray(I)V

    .line 107
    return-void
.end method

.method public setSize(FFII)V
    .locals 3
    .parameter "width"
    .parameter "height"
    .parameter "meshWidth"
    .parameter "meshHeight"

    .prologue
    .line 39
    iput p1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mWidth:F

    .line 40
    iput p2, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mHeight:F

    .line 41
    iput p3, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshWidth:I

    .line 42
    iput p4, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshHeight:I

    .line 43
    iget v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshHeight:I

    iget v2, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshWidth:I

    add-int/lit8 v2, v2, 0x1

    mul-int/2addr v1, v2

    mul-int/lit8 v1, v1, 0x2

    iput v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mFaceOffset:I

    .line 45
    iget v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshHeight:I

    add-int/lit8 v1, v1, 0x1

    iget v2, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshWidth:I

    add-int/lit8 v2, v2, 0x1

    mul-int v0, v1, v2

    .line 46
    .local v0, vertexCount:I
    mul-int/lit8 v1, v0, 0x3

    new-array v1, v1, [F

    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshVertex:[F

    .line 47
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshVertex:[F

    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFShadowPanel;->loadIdentityVertex([F)V

    .line 48
    mul-int/lit8 v1, v0, 0x4

    new-array v1, v1, [F

    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    .line 49
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshColor:[F

    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFShadowPanel;->loadIdentityColor([F)V

    .line 50
    mul-int/lit8 v1, v0, 0x2

    new-array v1, v1, [F

    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshTexCoord:[F

    .line 51
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mMeshTexCoord:[F

    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFShadowPanel;->loadIdentityTexCoord([F)V

    .line 53
    iget v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mFaceOffset:I

    mul-int/lit8 v1, v1, 0x3

    invoke-static {v1}, Lcom/nemustech/tiffany/world/TFShadowPanel;->newFloatBuffer(I)Ljava/nio/FloatBuffer;

    move-result-object v1

    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    .line 54
    iget v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mFaceOffset:I

    mul-int/lit8 v1, v1, 0x4

    invoke-static {v1}, Lcom/nemustech/tiffany/world/TFShadowPanel;->newFloatBuffer(I)Ljava/nio/FloatBuffer;

    move-result-object v1

    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mColorBuffer:Ljava/nio/FloatBuffer;

    .line 55
    iget v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mFaceOffset:I

    mul-int/lit8 v1, v1, 0x2

    invoke-static {v1}, Lcom/nemustech/tiffany/world/TFShadowPanel;->newFloatBuffer(I)Ljava/nio/FloatBuffer;

    move-result-object v1

    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    .line 56
    return-void
.end method

.method public setWidth(F)V
    .locals 0
    .parameter "width"

    .prologue
    .line 135
    iput p1, p0, Lcom/nemustech/tiffany/world/TFShadowPanel;->mWidth:F

    .line 136
    return-void
.end method
